#pragma once

#define UNKNOWN_CODE		0
#define AMAZON_CODE			1
#define DANGDANG_CODE		2


class CHtmlParser
{
public:
	virtual BOOL	ParseHtml() = 0;
	virtual UINT	GetSiteCode() = 0;
	virtual void	SetSiteCode(UINT) = 0;
	virtual TCHAR * GetPrice() = 0;
	virtual TCHAR * GetGoodsName() = 0;
	virtual IXImage	* GetImageObject() = 0;
};

class CAmazonParser : public CHtmlParser
{
public:
	CAmazonParser(const CString & strUrl, UINT nCode);
	~CAmazonParser();
	virtual BOOL ParseHtml();
	virtual UINT GetSiteCode();
	virtual void SetSiteCode(UINT nCode){m_nSiteCode = nCode;};
	virtual TCHAR * GetPrice(){return m_szPrice;};
	virtual TCHAR * GetGoodsName(){return m_szGoodsName;};
	virtual IXImage	* GetImageObject(){return m_pImage;};

private:
	UINT	m_nSiteCode;
	TCHAR	m_szPrice[MAX_PATH];
	TCHAR	m_szImagePath[MAX_PATH];
	TCHAR	m_szGoodsName[MAX_PATH];
	CString m_strUrl;
	IXImage	* m_pImage;
	
};

class CDangdangParser : public CHtmlParser
{
public:
	CDangdangParser(const CString & strUrl, UINT nCode);
	~CDangdangParser();
	virtual BOOL ParseHtml();
	virtual UINT GetSiteCode();
	virtual void SetSiteCode(UINT nCode){m_nSiteCode = nCode;};
	virtual TCHAR * GetPrice(){return m_szPrice;};
	virtual TCHAR * GetGoodsName(){return m_szGoodsName;};
	virtual IXImage	* GetImageObject(){return m_pImage;};
private:
	UINT	m_nSiteCode;
	TCHAR	m_szPrice[MAX_PATH];
	TCHAR	m_szGoodsName[MAX_PATH];
	TCHAR	m_szImagePath[MAX_PATH];
	CString m_strUrl;
	IXImage	* m_pImage;

};



